package com.icedevcloud.common.core.config;

import com.icedevcloud.common.core.advice.BaseResponseAdvice;
import com.icedevcloud.common.core.exception.GlobalExceptionHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * <p>
 * Air Web 自动配置
 * </p>
 *
 * @author XiaoBingBy
 * @since 2023-06-18
 */
@AutoConfiguration
public class WebAutoConfiguration {

    /**
     * 响应结果处理
     *
     * @return
     */
    @Bean
    public BaseResponseAdvice baseResponseHandler() {
        return new BaseResponseAdvice();
    }

    /**
     * 全局异常处理
     *
     * @return
     */
    @Bean
    public GlobalExceptionHandler globalExceptionHandler() {
        return new GlobalExceptionHandler();
    }


}
